package structural.decorator;

public class CompressedCloudStream implements IStream {
    private final IStream stream;

    public CompressedCloudStream(IStream stream) {
        this.stream = stream;
    }

    @Override
    public void write(String data) {
        String compressedData = compress(data);
        stream.write(compressedData);
    }

    private String compress(String data) {
        // Simple compression logic (for demonstration purposes)
        return data.replace(" ", "");
    }
}
